package com.fujitsu.nanjing.tieba.dao;

import com.fujitsu.nanjing.tieba.ibator.CoreModeratorLog;
import com.fujitsu.nanjing.tieba.ibator.CoreModeratorLogCriteria;
import java.util.List;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class CoreModeratorLogDAOImpl extends SqlMapClientDaoSupport implements CoreModeratorLogDAO {

    public CoreModeratorLogDAOImpl() {
        super();
    }

    public int countByExample(CoreModeratorLogCriteria example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("core_moderator_log.countByExample", example);
        return count;
    }

    public int deleteByExample(CoreModeratorLogCriteria example) {
        int rows = getSqlMapClientTemplate().delete("core_moderator_log.deleteByExample", example);
        return rows;
    }

    public int deleteByPrimaryKey(Integer logid) {
        CoreModeratorLog _key = new CoreModeratorLog();
        _key.setLogid(logid);
        int rows = getSqlMapClientTemplate().delete("core_moderator_log.deleteByPrimaryKey", _key);
        return rows;
    }

    public void insert(CoreModeratorLog record) {
        getSqlMapClientTemplate().insert("core_moderator_log.insert", record);
    }

    public void insertSelective(CoreModeratorLog record) {
        getSqlMapClientTemplate().insert("core_moderator_log.insertSelective", record);
    }

    @SuppressWarnings("unchecked")
    public List<CoreModeratorLog> selectByExample(CoreModeratorLogCriteria example) {
        List<CoreModeratorLog> list = getSqlMapClientTemplate().queryForList("core_moderator_log.selectByExample", example);
        return list;
    }

    public CoreModeratorLog selectByPrimaryKey(Integer logid) {
        CoreModeratorLog _key = new CoreModeratorLog();
        _key.setLogid(logid);
        CoreModeratorLog record = (CoreModeratorLog) getSqlMapClientTemplate().queryForObject("core_moderator_log.selectByPrimaryKey", _key);
        return record;
    }

    public int updateByExampleSelective(CoreModeratorLog record, CoreModeratorLogCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("core_moderator_log.updateByExampleSelective", parms);
        return rows;
    }

    public int updateByExample(CoreModeratorLog record, CoreModeratorLogCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("core_moderator_log.updateByExample", parms);
        return rows;
    }

    public int updateByPrimaryKeySelective(CoreModeratorLog record) {
        int rows = getSqlMapClientTemplate().update("core_moderator_log.updateByPrimaryKeySelective", record);
        return rows;
    }

    public int updateByPrimaryKey(CoreModeratorLog record) {
        int rows = getSqlMapClientTemplate().update("core_moderator_log.updateByPrimaryKey", record);
        return rows;
    }

    protected static class UpdateByExampleParms extends CoreModeratorLogCriteria {
        private Object record;

        public UpdateByExampleParms(Object record, CoreModeratorLogCriteria example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}